#!/bin/bash

# 设置pip源为阿里镜像站
pip config set global.timeout 120
pip config set global.trusted-host mirrors.aliyun.com
pip config set global.index-url http://mirrors.aliyun.com/pypi/simple/
# 如果设置为华为云则使用，下面两条命令
# pip config set global.trusted-host repo.huaweicloud.com
# pip config set global.index-url http://repo.huaweicloud.com/repository/pypi/simple/

# 下载repo工具
[ -e ~/bin/ ] || mkdir ~/bin/
curl -s https://gitee.com/oschina/repo/raw/fork_flow/repo-py3 > ~/bin/repo
chmod +x ~/bin/repo
pip install requests # 码云的 repo 依赖这个pip包
echo 'export PATH=$PATH:~/bin' | tee -a ~/.bashrc
